//
//  squareCommentHeader.m
//  FastRunDemo
//
//  Created by 苟亚明 on 16/9/24.
//  Copyright © 2016年 苟亚明. All rights reserved.
//

#import "squareCommentHeader.h"
#import "squareList.h"
#import <UIImageView+WebCache.h>
#import "NSString+CZNSStringExt.h"
@implementation squareCommentHeader

- (void)setTopics:(squareList *)topics{
    _topics = topics;
    [self.imgIcon sd_setImageWithURL:[NSURL URLWithString:topics.profile_image] placeholderImage:[UIImage imageNamed:@"btn_girl_press"]];
    self.lblName.text = topics.screen_name;
    self.lblTime.text = topics.created_at;
    self.lblText.text = topics.text;
    
    
}

- (void)awakeFromNib{
    [super awakeFromNib];
}


- (void)layoutSubviews{
    [super layoutSubviews];
    self.width = GYMScreenW;
    CGFloat lblH = [self.topics.text sizeOfTextWithMaxSize:CGSizeMake(GYMScreenW - 20, MAXFLOAT) font:[UIFont systemFontOfSize:16]].height;
    self.lblText.height = lblH;
    self.height = CGRectGetMaxY(self.lblText.frame) + 10;
    self.topics.cellHeight = self.height;
    
}

@end
